<#if parentId?has_content>
<ul>
    <@cms.categoryList advanced=true parentId=parentId pageSize=500>
        <#list page.list as a>
            <@t.merge 'categoryIds' a.id!/>
        </#list>
        <@sys.deptItem itemType='category' deptId=admin.deptId!'' itemIds=t.categoryIds!><#assign deptCategoryMap=map!/></@sys.deptItem>
        <#list page.list as a>
            <#if (deptCategoryMap[a.id?string])?has_content&&deptCategoryMap[a.id?string]>
                <li <#if a.childIds?has_content>_src="cmsContent/moveParameters.html?parentId=${a.id}"</#if>>
                    <a href="javascript:;" class="exclude-translate" onclick="$('input[name=categoryId]',$.pdialog.getCurrent()).val('${a.id}');$('form',$.pdialog.getCurrent()).trigger('submit');" target="ajax">${a.name!}</a>
                </li>
            </#if>
        </#list>
    </@cms.categoryList>
</ul>
<#else>
<script>
$('table tbody tr input[name=ids]',navTab.getCurrentPanel()).each(function(){
    if($(this).is(":checked")){
        $('<input type="hidden" name="ids" value="'+$(this).val()+'"/>').appendTo($('.idsToMove',$.pdialog.getCurrent()));
    }
});
if(0==$('.idsToMove input',$.pdialog.getCurrent()).length){
    alertMsg.error('<@t.page 'content.please_select'/>');
    $.pdialog.closeCurrent();
}
</script>
<div class="pageFormContent" layoutH>
    <form action="cmsContent/move?callbackType=closeCurrent" method="post" autocomplete="off" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
        <input type="hidden" name="categoryId" value=""/>
        <input type="hidden" name="_csrf" value="<@tools.csrfToken admin=true/>"/>
        <div class="idsToMove"></div>
    </form>
    <ul class="tree treeFolder">
        <li>
            <a href="javascript:;" onclick="return false;"><@t.page 'category.select'/></a>
            <ul>
            <@cms.categoryList advanced=true pageSize=500>
                <#list page.list as a>
                    <@t.merge 'categoryIds' a.id!/>
                </#list>
                <@sys.deptItem itemType='category' deptId=admin.deptId!'' itemIds=t.categoryIds!><#assign deptCategoryMap=map!/></@sys.deptItem>
                <#list page.list as a>
                    <#if (deptCategoryMap[a.id?string])?has_content&&deptCategoryMap[a.id?string]>
                        <li<#if a.childIds?has_content> _src="cmsContent/moveParameters.html?parentId=${a.id}"</#if>>
                            <a href="javascript:;" class="exclude-translate" onclick="$('input[name=categoryId]',$.pdialog.getCurrent()).val('${a.id}');$('form',$.pdialog.getCurrent()).trigger('submit');" target="ajax">${a.name!}</a>
                        </li>
                    </#if>
                <#else>
                    <li><a><@t.page 'empty_directory'/></a></li>
                </#list>
            </@cms.categoryList>
            </ul>
        </li>
    </ul>
</div>
<div class="formBar">
    <ul>
        <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
    </ul>
</div>
</#if>